export default [{
  Component: {
    properties: {
      vModel: {
        type: String,
        value: "",
        observer: function (newVal, oldVal) {
          // 赋值时,防止页面未创建
          setTimeout(() => {
            // 获取页面数据并初始化赋值
            let curPage = wx.getCurrentPageTarget()
            this.setData({
              value: curPage.data[newVal]
            })
            if (!curPage.ak_components)  curPage.ak_components = []
            curPage.ak_components.push(this)
          }, 10)
        }
      },
    },
    created() {
      // 创建组件
    },
    data: {
      value: ""
    },
    ready() {
      // bindSetData(this)
    },
    methods: {
      inputData(e) {
        const {
          value
        } = e.detail
        const name = this.data["vModel"]
        let curPage = wx.getCurrentPageTarget()
        const params = {}
        params[name] = value
        curPage.setData(params)
        this.triggerEvent("input", e)
      }
    }
  }
}]

